package com.situ.spring.service.impl;

import com.situ.spring.dao.IStudentDao;
import com.situ.spring.service.IStudentService;

public class StudentServiceImpl implements IStudentService {
    // private IStudentDao studentDao = new StudentDaoImpl();
    private IStudentDao studentDao;

    // DI
    public void setStudentDao(IStudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public void selectAll() {
        // 关注点代码
        // System.out.println("StudentServiceImpl.selectAll 开启事物");
        // 业务代码
        System.out.println("StudentServiceImpl.selectAll");
        // studentDao.selectAll();

        // System.out.println("StudentServiceImpl.selectAll 关闭事物");
    }

    @Override
    public void deleteById() {
        //System.out.println("StudentServiceImpl.deleteById 开启事物");

        System.out.println("StudentServiceImpl.deleteById");

        //System.out.println("StudentServiceImpl.deleteById 关闭事物");
    }
}
